import React, { Component } from 'react';
import { Route, Switch, withRouter} from 'react-router-dom'
import SearchMain from './search_main';
import url from '../constants/url';
import UsageComponent from './usage';
import { About, Privacy } from './Footer'
import { connect } from 'react-redux'
import { is } from 'immutable'

class Main extends Component{
    componentDidMount() {

    }

    shouldComponentUpdate(nextProps, nextState){
        return !(this.props === nextProps || is(this.props, nextProps)) ||
            !(this.state === nextState || is(this.state, nextState));
    }

    render() {

        return (
            <Switch>
                <Route exact path={url.root} component={SearchMain}/>
                <Route path={url.about} component={About}/>
                <Route path={url.privacy} component={Privacy}/>
            </Switch>
        )


    }
}

export default withRouter(Main);